package com.example.hcmiu.englishforkid;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Locale;
import java.util.Random;

import SQLite.DatabaseHandler2;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class GameListenAndGuessActivity extends Activity {
	ArrayList<Quizz> quizzes;
	Quizz currentQuizz;
	int quizzIndex = 0;

	TextToSpeech ttobj;
	ImageView check1;// = (ImageView) findViewById(R.id.imageView1);
	ImageView check2;// = (ImageView) findViewById(R.id.imageView3);
	ImageView check3;// = (ImageView) findViewById(R.id.imageView5);
	ImageView check4;// = (ImageView) findViewById(R.id.imageView4);
	DatabaseHandler2 db;// = new DatabaseHandler(this);

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_game_listen_and_guess);
		MainActivity.CurrentActivity = this;
		ttobj = new TextToSpeech(getApplicationContext(),
				new TextToSpeech.OnInitListener() {
					@Override
					public void onInit(int status) {
						if (status != TextToSpeech.ERROR) {
							ttobj.setLanguage(Locale.UK);
						}
					}
				});

		db = new DatabaseHandler2(this);

		quizzes = new ArrayList<GameListenAndGuessActivity.Quizz>();

		GameItem.LoadGameItem();
		GameItem.GetQuiz();
		for (int i = 0; i < GameItem.currentGameItem.size(); i++) {
			GameItem v = GameItem.currentGameItem.get(i);
			System.out.println(v.name + "->" + v.drawable);
			quizzes.add(new Quizz(v));
		}
		System.out.println("QUIZZZZZZZZZ");
		for (Quizz quizz : quizzes) {
			System.out.println("====================");
			try {
				System.out.println("a1 = " + quizz.a1.name);
				System.out.println("a2 = " + quizz.a2.name);
				System.out.println("a3 = " + quizz.a3.name);
				System.out.println("a4 = " + quizz.a4.name);
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		ic_wrong = getResources().getDrawable(
				getResources().getIdentifier("ic_wrong", "drawable",
						getPackageName()));
		ic_correct = getResources().getDrawable(
				getResources().getIdentifier("ic_check", "drawable",
						getPackageName()));

		final Button a1 = (Button) findViewById(R.id.buttonONE);
		final Button a2 = (Button) findViewById(R.id.buttonTWO);
		final Button a3 = (Button) findViewById(R.id.buttonTHREE);
		final Button a4 = (Button) findViewById(R.id.buttonFOUR);

		final Button buttonNext = (Button) findViewById(R.id.button1);
		final Button buttonPrev = (Button) findViewById(R.id.button2);
		final Button buttonSpeaker = (Button) findViewById(R.id.buttonSpeaker);

		final TextView tvIndex = (TextView) findViewById(R.id.textView1);

		check1 = (ImageView) findViewById(R.id.imageView1);
		check2 = (ImageView) findViewById(R.id.imageView3);
		check3 = (ImageView) findViewById(R.id.imageView5);
		check4 = (ImageView) findViewById(R.id.imageView4);

		buttonSpeaker.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				ttobj.speak(currentQuizz.getQuestion().name,
						TextToSpeech.QUEUE_FLUSH, null);
			}
		});

		currentQuizz = quizzes.get(quizzIndex);
		ShowQuiz(a1, a2, a3, a4, buttonNext, buttonPrev, tvIndex);

		buttonNext.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				quizzIndex++;

				currentQuizz = quizzes.get(quizzIndex);
				ShowQuiz(a1, a2, a3, a4, buttonNext, buttonPrev, tvIndex);
			}
		});

		buttonPrev.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				quizzIndex--;
				currentQuizz = quizzes.get(quizzIndex);
				ShowQuiz(a1, a2, a3, a4, buttonNext, buttonPrev, tvIndex);
			}
		});

	}

	public void DoAnswer(View v) {

		switch (v.getId()) {

		case R.id.buttonONE:
		case R.id.imageView1:
			currentQuizz.indexAnswer = 0;

			break;
		case R.id.buttonTWO:
		case R.id.imageView3:
			currentQuizz.indexAnswer = 1;
			break;
		case R.id.buttonTHREE:
		case R.id.imageView5:
			currentQuizz.indexAnswer = 2;
			break;
		case R.id.buttonFOUR:
		case R.id.imageView4:
			currentQuizz.indexAnswer = 3;
			break;
		}

		doCheck(true);

		if (quizzIndex >= 19) {
			HTMLActivity.Show("CORRECT : " + correct
					+ "/20. Press back to Review");
		}
	}

	private void ShowQuiz(Button a1, Button a2, Button a3, Button a4,
			Button buttonNext, Button buttonPrev, TextView tvIndex) {

		if (quizzIndex >= 19)
			quizzIndex = 19;
		if (quizzIndex <= 0)
			quizzIndex = 0;

		tvIndex.setText((quizzIndex + 1) + "/20");

		Resources resources = getResources();

		a1.setBackground(resources.getDrawable(resources.getIdentifier(
				currentQuizz.a1.drawable, "drawable", getPackageName())));

		a2.setBackground(resources.getDrawable(resources.getIdentifier(
				currentQuizz.a2.drawable, "drawable", getPackageName())));

		a3.setBackground(resources.getDrawable(resources.getIdentifier(
				currentQuizz.a3.drawable, "drawable", getPackageName())));

		a4.setBackground(resources.getDrawable(resources.getIdentifier(
				currentQuizz.a4.drawable, "drawable", getPackageName())));

		ttobj.speak(currentQuizz.getQuestion().name, TextToSpeech.QUEUE_FLUSH,
				null);

		doCheck(false);

		if (quizzIndex >= 19) {
			buttonNext.setVisibility(View.INVISIBLE);
		} else {
			buttonNext.setVisibility(View.VISIBLE);
		}

		if (quizzIndex > 0) {
			buttonPrev.setVisibility(View.VISIBLE);
		} else {
			buttonPrev.setVisibility(View.INVISIBLE);
		}
	}

	Drawable ic_wrong;
	Drawable ic_correct;

	private void doCheck(boolean dbready) {

		check1.setVisibility(View.INVISIBLE);
		check2.setVisibility(View.INVISIBLE);
		check3.setVisibility(View.INVISIBLE);
		check4.setVisibility(View.INVISIBLE);

		check1.setImageResource(R.drawable.ic_wrong);
		check2.setImageResource(R.drawable.ic_wrong);
		check3.setImageResource(R.drawable.ic_wrong);
		check4.setImageResource(R.drawable.ic_wrong);

		// check2.setImageDrawable(ic_wrong);
		// check3.setImageDrawable(ic_wrong);
		// check4.setImageDrawable(ic_wrong);

		if (currentQuizz.indexQuesion == 0)
			check1.setImageResource(R.drawable.ic_check);
		if (currentQuizz.indexQuesion == 1)
			check2.setImageResource(R.drawable.ic_check);
		if (currentQuizz.indexQuesion == 2)
			check3.setImageResource(R.drawable.ic_check);
		if (currentQuizz.indexQuesion == 3)
			check4.setImageResource(R.drawable.ic_check);

		// if (currentQuizz.indexAnswer == 0)
		// check1.setImageDrawable(ic_correct);
		// if (currentQuizz.indexAnswer == 1)
		// check2.setImageDrawable(ic_correct);
		// if (currentQuizz.indexAnswer == 2)
		// check3.setImageDrawable(ic_correct);
		// if (currentQuizz.indexAnswer == 3)
		// check4.setImageDrawable(ic_correct);

		if (currentQuizz.indexAnswer == 0)
			check1.setVisibility(View.VISIBLE);
		if (currentQuizz.indexAnswer == 1)
			check2.setVisibility(View.VISIBLE);
		if (currentQuizz.indexAnswer == 2)
			check3.setVisibility(View.VISIBLE);
		if (currentQuizz.indexAnswer == 3)
			check4.setVisibility(View.VISIBLE);

		if (dbready) {
			if (currentQuizz.status == 0) {// chưa làm
				db.updateAnswer(currentQuizz.a1.type,
						currentQuizz.indexAnswer == currentQuizz.indexQuesion);
				currentQuizz.status = currentQuizz.indexAnswer == currentQuizz.indexQuesion ? 1
						: 2;

				correct = currentQuizz.indexAnswer == currentQuizz.indexQuesion ? correct + 1
						: correct;
				System.out.println(correct);
				System.out
						.println(currentQuizz.indexAnswer == currentQuizz.indexQuesion);
			}
		}
	}

	public int correct = 0;

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	public static class Quizz {

		public int status;

		@Override
		public String toString() {
			return a1.id + " " + a2.id + " " + a3.id + " " + a4.id
					+ indexQuesion + " " + indexAnswer;
		}

		public void fromString(String v) {

			String[] a = v.split("\\s");

			int id_a1 = Integer.parseInt(a[0]);
			int id_a2 = Integer.parseInt(a[1]);
			int id_a3 = Integer.parseInt(a[2]);
			int id_a4 = Integer.parseInt(a[3]);

			int idx_question = Integer.parseInt(a[4]);
			int idx_answer = Integer.parseInt(a[5]);

			a1 = GameItem.searchByID(id_a1);
			a2 = GameItem.searchByID(id_a2);
			a3 = GameItem.searchByID(id_a3);
			a4 = GameItem.searchByID(id_a4);

			indexAnswer = idx_answer;
			indexQuesion = idx_question;

		}

		public GameItem a1;
		public GameItem a2;
		public GameItem a3;
		public GameItem a4;

		public int indexQuesion;
		public int indexAnswer = -1;

		public GameItem getQuestion() {
			if (indexQuesion == 0)
				return a1;
			if (indexQuesion == 1)
				return a2;
			if (indexQuesion == 2)
				return a3;
			if (indexQuesion == 3)
				return a4;

			return null;
		}

		public Quizz(GameItem a1, GameItem a2, GameItem a3, GameItem a4) {

			this.a1 = a1;
			this.a2 = a2;
			this.a3 = a3;
			this.a4 = a4;
		}

		public Quizz() {
		}

		public Quizz(GameItem a1) {
			this.a1 = a1;

			indexQuesion = new Random().nextInt(3);

			for (int i = 0; i < GameItem.gameItems.size(); i++) {
				GameItem item = GameItem.gameItems.get(i);
				if (item.type.equals(a1.type) && !item.name.equals(a1.name)) {

					if (this.a2 == null) {
						a2 = item;
					} else if (this.a3 == null) {
						a3 = item;
					} else if (this.a4 == null) {
						a4 = item;
						break;
					}
				}
			}

			if (indexQuesion == 1) {
				GameItem v = this.a1;
				this.a1 = this.a2;
				this.a2 = v;
			} else if (indexQuesion == 2) {
				GameItem v = this.a1;
				this.a1 = this.a3;
				this.a3 = v;
			} else if (indexQuesion == 3) {
				GameItem v = this.a1;
				this.a1 = this.a4;
				this.a4 = v;
			}
		}

	}

	public static class GameItem {
		public static ArrayList<GameItem> currentGameItem;

		public static void GetQuiz() {
			shuffleArray(types);

			ArrayList<String> quiztype = new ArrayList<String>();

			// chon 20 cau hoi
			for (int i = 0; i < 10; i++) {
				quiztype.add(types[i]);
			}
			for (int i = 0; i < 10; i++) {
				quiztype.add(types[i]);
			}

			currentGameItem = new ArrayList<GameListenAndGuessActivity.GameItem>();
			for (String type : quiztype) {
				GetQuizz(type);
			}

		}

		private static void GetQuizz(String type2) {

			Collections.shuffle(gameItems);

			GameItem gameitemSelected = null;

			for (int i = 0; i < gameItems.size(); i++) {

				GameItem gameitem = gameItems.get(i);

				if (gameitem.type.equals(type2)
						&& !currentGameItem.contains(gameitem)) {

					if (gameitemSelected == null) {
						gameitemSelected = gameitem;
						currentGameItem.add(gameitemSelected);
						return;
					}

				}

			}

		}

		static void shuffleArray(Object[] ar) {
			Random rnd = new Random();
			for (int i = ar.length - 1; i > 0; i--) {
				int index = rnd.nextInt(i + 1);
				// Simple swap
				Object a = ar[index];
				ar[index] = ar[i];
				ar[i] = a;
			}
		}

		public static String[] types = new String[] {

		"animal", "christmas", "color", "country", "drink", "flowers", "food",
				"fruit", "geometry", "house", "letters", "number", "school",
				"vehicle" };

		public static GameItem searchByID(int id) {

			for (int i = 0; i < gameItems.size(); i++) {
				if (gameItems.get(i).id == id)
					return gameItems.get(i);
			}
			return null;

		}

		public static ArrayList<GameItem> gameItems;

		public static void LoadGameItem() {
			gameItems = new ArrayList<GameListenAndGuessActivity.GameItem>();

			gameItems.add(new GameItem("Bread", "@drawable/bread", "food"));
			gameItems.add(new GameItem("Cheese", "@drawable/cheese", "food"));
			gameItems.add(new GameItem("Chocolate", "@drawable/chocolate",
					"food"));
			gameItems
					.add(new GameItem("Cupcakes", "@drawable/cupcakes", "food"));
			gameItems.add(new GameItem("Egg", "@drawable/egg", "food"));
			gameItems.add(new GameItem("Ice Cream", "@drawable/ice_cream",
					"food"));
			gameItems
					.add(new GameItem("Lollipop", "@drawable/lollipop", "food"));
			gameItems.add(new GameItem("Pizza", "@drawable/pizza", "food"));
			gameItems.add(new GameItem("Rice", "@drawable/rice", "food"));
			gameItems
					.add(new GameItem("Circle", "@drawable/circle", "geometry"));
			gameItems.add(new GameItem("Cross", "@drawable/cross", "geometry"));
			gameItems.add(new GameItem("Diamond", "@drawable/diamond",
					"geometry"));
			gameItems.add(new GameItem("Heart", "@drawable/heart", "geometry"));
			gameItems.add(new GameItem("Hexagon", "@drawable/hexagon",
					"geometry"));
			gameItems.add(new GameItem("Oval", "@drawable/oval", "geometry"));
			gameItems.add(new GameItem("Pentagon", "@drawable/pentagon",
					"geometry"));
			gameItems.add(new GameItem("Rectangle", "@drawable/rectangle",
					"geometry"));
			gameItems
					.add(new GameItem("Square", "@drawable/square", "geometry"));
			gameItems.add(new GameItem("Star", "@drawable/star", "geometry"));
			gameItems.add(new GameItem("Trapezoid", "@drawable/trapezoid",
					"geometry"));
			gameItems.add(new GameItem("Triangle", "@drawable/triangle",
					"geometry"));
			gameItems
					.add(new GameItem("Bells", "@drawable/bells", "christmas"));
			gameItems.add(new GameItem("Candles", "@drawable/candles",
					"christmas"));
			gameItems.add(new GameItem("Candy Cane", "@drawable/candy_cane",
					"christmas"));
			gameItems.add(new GameItem("Chrismas Card",
					"@drawable/chrismas_card", "christmas"));
			gameItems.add(new GameItem("Chrismas Tree",
					"@drawable/chrismas_tree", "christmas"));
			gameItems.add(new GameItem("Presents", "@drawable/presents",
					"christmas"));
			gameItems.add(new GameItem("Reindeer", "@drawable/reindeer",
					"christmas"));
			gameItems.add(new GameItem("Santa Claus", "@drawable/santa_claus",
					"christmas"));
			gameItems.add(new GameItem("Snowman", "@drawable/snowman",
					"christmas"));
			gameItems.add(new GameItem("Stocking", "@drawable/stocking",
					"christmas"));
			gameItems.add(new GameItem("Armchair", "@drawable/armchair",
					"house"));
			gameItems.add(new GameItem("Bar Stool", "@drawable/bar_stool",
					"house"));
			gameItems.add(new GameItem("Bed", "@drawable/bed", "house"));
			gameItems.add(new GameItem("Bookcase", "@drawable/bookcase",
					"house"));
			gameItems.add(new GameItem("Chair", "@drawable/chair", "house"));
			gameItems.add(new GameItem("Clock", "@drawable/clock", "house"));
			gameItems.add(new GameItem("Knife", "@drawable/knife", "house"));
			gameItems.add(new GameItem("Phone", "@drawable/phone", "house"));
			gameItems
					.add(new GameItem("Picture", "@drawable/picture", "house"));
			gameItems.add(new GameItem("Sofa", "@drawable/sofa", "house"));
			gameItems.add(new GameItem("Table", "@drawable/table", "house"));
			gameItems.add(new GameItem("Television", "@drawable/television",
					"house"));
			gameItems.add(new GameItem("Board", "@drawable/board", "school"));
			gameItems.add(new GameItem("Book", "@drawable/book", "school"));
			gameItems.add(new GameItem("Eraser", "@drawable/eraser", "school"));
			gameItems.add(new GameItem("Globe", "@drawable/globe", "school"));
			gameItems.add(new GameItem("Map", "@drawable/map", "school"));
			gameItems.add(new GameItem("Notebook", "@drawable/notebook",
					"school"));
			gameItems.add(new GameItem("Pencil", "@drawable/pencil", "school"));
			gameItems.add(new GameItem("Ruler", "@drawable/ruler", "school"));
			gameItems.add(new GameItem("Schoolbag", "@drawable/schoolbag",
					"school"));
			gameItems
					.add(new GameItem("Teacher", "@drawable/teacher", "school"));
			gameItems.add(new GameItem("Bike", "@drawable/bike", "vehicle"));
			gameItems.add(new GameItem("Bus", "@drawable/bus", "vehicle"));
			gameItems.add(new GameItem("Car", "@drawable/car", "vehicle"));
			gameItems.add(new GameItem("Cruise Bike", "@drawable/cruise_bike",
					"vehicle"));
			gameItems.add(new GameItem("Helicopter", "@drawable/helicopter",
					"vehicle"));
			gameItems.add(new GameItem("Truck", "@drawable/truck", "vehicle"));
			gameItems.add(new GameItem("Plane", "@drawable/plane", "vehicle"));
			gameItems.add(new GameItem("Ship", "@drawable/ship", "vehicle"));
			gameItems.add(new GameItem("Train", "@drawable/train", "vehicle"));
			gameItems.add(new GameItem("Argentina", "@drawable/argentina",
					"country"));
			gameItems.add(new GameItem("Australia", "@drawable/australia",
					"country"));
			gameItems.add(new GameItem("Belgium", "@drawable/belgium",
					"country"));
			gameItems
					.add(new GameItem("Brazil", "@drawable/brazil", "country"));
			gameItems.add(new GameItem("Cambodia", "@drawable/cambodia",
					"country"));
			gameItems
					.add(new GameItem("Canada", "@drawable/canada", "country"));
			gameItems.add(new GameItem("China", "@drawable/china", "country"));
			gameItems.add(new GameItem("Costa Rica", "@drawable/costa_rica",
					"country"));
			gameItems.add(new GameItem("Croatia", "@drawable/croatia",
					"country"));
			gameItems.add(new GameItem("Cuba", "@drawable/cuba", "country"));
			gameItems.add(new GameItem("Czech Republic",
					"@drawable/czech_republic", "country"));
			gameItems.add(new GameItem("Finland", "@drawable/finland",
					"country"));
			gameItems
					.add(new GameItem("France", "@drawable/france", "country"));
			gameItems.add(new GameItem("Ireland", "@drawable/ireland",
					"country"));
			gameItems.add(new GameItem("Japan", "@drawable/japan", "country"));
			gameItems.add(new GameItem("Laos", "@drawable/laos", "country"));
			gameItems.add(new GameItem("Netherlands", "@drawable/netherlands",
					"country"));
			gameItems
					.add(new GameItem("Russia", "@drawable/russia", "country"));
			gameItems.add(new GameItem("South Korea", "@drawable/south_korea",
					"country"));
			gameItems.add(new GameItem("Singapore", "@drawable/singapore",
					"country"));
			gameItems.add(new GameItem("Thailand", "@drawable/thailand",
					"country"));
			gameItems.add(new GameItem("United Kingdom", "@drawable/uk",
					"country"));
			gameItems.add(new GameItem("United States",
					"@drawable/united_states", "country"));
			gameItems.add(new GameItem("Vietnam", "@drawable/vietnam",
					"country"));
			gameItems.add(new GameItem("Western Sahara",
					"@drawable/western_sahara", "country"));
			gameItems.add(new GameItem("Yemen", "@drawable/yemen", "country"));
			gameItems.add(new GameItem("Zimbabwe", "@drawable/zimbabwe",
					"country"));
			gameItems.add(new GameItem("Beer", "@drawable/beer", "drink"));
			gameItems.add(new GameItem("Cocktail", "@drawable/cocktail",
					"drink"));
			gameItems.add(new GameItem("Coffee", "@drawable/coffee", "drink"));
			gameItems.add(new GameItem("Juice", "@drawable/juice", "drink"));
			gameItems.add(new GameItem("Milk", "@drawable/milk", "drink"));
			gameItems.add(new GameItem("Soda", "@drawable/soda", "drink"));
			gameItems.add(new GameItem("Tea", "@drawable/tea", "drink"));
			gameItems.add(new GameItem("Water", "@drawable/water", "drink"));
			gameItems.add(new GameItem("Wine", "@drawable/wine", "drink"));
			gameItems.add(new GameItem("Black", "@drawable/black", "color"));
			gameItems.add(new GameItem("Blue", "@drawable/blue", "color"));
			gameItems.add(new GameItem("Brown", "@drawable/brown", "color"));
			gameItems.add(new GameItem("Green", "@drawable/green", "color"));
			gameItems.add(new GameItem("Grey", "@drawable/grey", "color"));
			gameItems.add(new GameItem("Navy", "@drawable/navy", "color"));
			gameItems
					.add(new GameItem("Orange", "@drawable/orange_cl", "color"));
			gameItems.add(new GameItem("Pink", "@drawable/pink", "color"));
			gameItems.add(new GameItem("Purple", "@drawable/purple", "color"));
			gameItems.add(new GameItem("Red", "@drawable/red", "color"));
			gameItems.add(new GameItem("White", "@drawable/white", "color"));
			gameItems.add(new GameItem("Yellow", "@drawable/yellow", "color"));
			gameItems.add(new GameItem("Apple", "@drawable/apple", "fruit"));
			gameItems.add(new GameItem("Orange", "@drawable/orange", "fruit"));
			gameItems.add(new GameItem("Pineapple", "@drawable/pineapple",
					"fruit"));
			gameItems.add(new GameItem("Strawberry", "@drawable/strawberry",
					"fruit"));
			gameItems.add(new GameItem("Banana", "@drawable/banana", "fruit"));
			gameItems.add(new GameItem("Cherry", "@drawable/cherry", "fruit"));
			gameItems
					.add(new GameItem("Coconut", "@drawable/coconut", "fruit"));
			gameItems.add(new GameItem("Grapes", "@drawable/grapes", "fruit"));
			gameItems.add(new GameItem("Kiwi", "@drawable/kiwi", "fruit"));
			gameItems.add(new GameItem("Lemon", "@drawable/lemon", "fruit"));
			gameItems.add(new GameItem("Mango", "@drawable/mango", "fruit"));
			gameItems.add(new GameItem("Pear", "@drawable/pear", "fruit"));
			gameItems.add(new GameItem("Tomato", "@drawable/tomato", "fruit"));
			gameItems.add(new GameItem("Watermelon", "@drawable/watermelon",
					"fruit"));
			gameItems
					.add(new GameItem("Apricot", "@drawable/apricot", "fruit"));
			gameItems.add(new GameItem("Chilli", "@drawable/chilli", "fruit"));
			gameItems.add(new GameItem("Guava", "@drawable/guava", "fruit"));
			gameItems.add(new GameItem("Litchi", "@drawable/litchi", "fruit"));
			gameItems.add(new GameItem("Peach", "@drawable/peach", "fruit"));
			gameItems.add(new GameItem("Pomegranate", "@drawable/pomegranate",
					"fruit"));
			gameItems.add(new GameItem("One", "@drawable/one", "number"));
			gameItems.add(new GameItem("Two", "@drawable/two", "number"));
			gameItems.add(new GameItem("Three", "@drawable/three", "number"));
			gameItems.add(new GameItem("Four", "@drawable/four", "number"));
			gameItems.add(new GameItem("Five", "@drawable/five", "number"));
			gameItems.add(new GameItem("Six", "@drawable/six", "number"));
			gameItems.add(new GameItem("Seven", "@drawable/seven", "number"));
			gameItems.add(new GameItem("Eight", "@drawable/eight", "number"));
			gameItems.add(new GameItem("Nine", "@drawable/nine", "number"));
			gameItems.add(new GameItem("Ten", "@drawable/ten", "number"));
			gameItems.add(new GameItem("Cat", "@drawable/cat", "animal"));
			gameItems
					.add(new GameItem("Chicken", "@drawable/chicken", "animal"));
			gameItems.add(new GameItem("Cow", "@drawable/cow", "animal"));
			gameItems.add(new GameItem("Dog", "@drawable/dog", "animal"));
			gameItems.add(new GameItem("Pig", "@drawable/pig", "animal"));
			gameItems.add(new GameItem("Bee", "@drawable/bee", "animal"));
			gameItems.add(new GameItem("Butterfly", "@drawable/butterfly",
					"animal"));
			gameItems.add(new GameItem("Camel", "@drawable/camel", "animal"));
			gameItems.add(new GameItem("Crab", "@drawable/crab", "animal"));
			gameItems
					.add(new GameItem("Cricket", "@drawable/cricket", "animal"));
			gameItems
					.add(new GameItem("Dolphin", "@drawable/dolphin", "animal"));
			gameItems.add(new GameItem("Dove", "@drawable/dove", "animal"));
			gameItems.add(new GameItem("Duck", "@drawable/duck", "animal"));
			gameItems.add(new GameItem("Elephant", "@drawable/elephant",
					"animal"));
			gameItems.add(new GameItem("Frog", "@drawable/frog", "animal"));
			gameItems
					.add(new GameItem("Giraffe", "@drawable/giraffe", "animal"));
			gameItems.add(new GameItem("Hippopotamus",
					"@drawable/hippopotamus", "animal"));
			gameItems.add(new GameItem("Horse", "@drawable/horse", "animal"));
			gameItems.add(new GameItem("Lion", "@drawable/lion", "animal"));
			gameItems.add(new GameItem("Monkey", "@drawable/monkey", "animal"));
			gameItems.add(new GameItem("Owl", "@drawable/owl", "animal"));
			gameItems.add(new GameItem("Parrot", "@drawable/parrot", "animal"));
			gameItems.add(new GameItem("Penguine", "@drawable/penguine",
					"animal"));
			gameItems.add(new GameItem("Shark", "@drawable/shark", "animal"));
			gameItems.add(new GameItem("Sheep", "@drawable/sheep", "animal"));
			gameItems.add(new GameItem("Snake", "@drawable/snake", "animal"));
			gameItems.add(new GameItem("Spider", "@drawable/spider", "animal"));
			gameItems.add(new GameItem("Whale", "@drawable/whale", "animal"));
			gameItems.add(new GameItem("Zebra", "@drawable/zebra", "animal"));
			gameItems.add(new GameItem("A", "@drawable/a", "letters"));
			gameItems.add(new GameItem("B", "@drawable/b", "letters"));
			gameItems.add(new GameItem("C", "@drawable/c", "letters"));
			gameItems.add(new GameItem("D", "@drawable/d", "letters"));
			gameItems.add(new GameItem("E", "@drawable/e", "letters"));
			gameItems.add(new GameItem("F", "@drawable/f", "letters"));
			gameItems.add(new GameItem("G", "@drawable/g", "letters"));
			gameItems.add(new GameItem("H", "@drawable/h", "letters"));
			gameItems.add(new GameItem("I", "@drawable/i", "letters"));
			gameItems.add(new GameItem("J", "@drawable/j", "letters"));
			gameItems.add(new GameItem("K", "@drawable/k", "letters"));
			gameItems.add(new GameItem("L", "@drawable/l", "letters"));
			gameItems.add(new GameItem("M", "@drawable/m", "letters"));
			gameItems.add(new GameItem("N", "@drawable/n", "letters"));
			gameItems.add(new GameItem("O", "@drawable/o", "letters"));
			gameItems.add(new GameItem("P", "@drawable/p", "letters"));
			gameItems.add(new GameItem("Q", "@drawable/q", "letters"));
			gameItems.add(new GameItem("R", "@drawable/r", "letters"));
			gameItems.add(new GameItem("S", "@drawable/s", "letters"));
			gameItems.add(new GameItem("T", "@drawable/t", "letters"));
			gameItems.add(new GameItem("U", "@drawable/u", "letters"));
			gameItems.add(new GameItem("V", "@drawable/v", "letters"));
			gameItems.add(new GameItem("W", "@drawable/w", "letters"));
			gameItems.add(new GameItem("X", "@drawable/x", "letters"));
			gameItems.add(new GameItem("Y", "@drawable/y", "letters"));
			gameItems.add(new GameItem("Z", "@drawable/z", "letters"));
			gameItems.add(new GameItem("Aster", "@drawable/aster", "flowers"));
			gameItems.add(new GameItem("Buttercups", "@drawable/buttercups",
					"flowers"));
			gameItems.add(new GameItem("Carnation", "@drawable/carnation",
					"flowers"));
			gameItems.add(new GameItem("Daffodil", "@drawable/daffodil",
					"flowers"));
			gameItems.add(new GameItem("Erigeron", "@drawable/erigeron",
					"flowers"));
			gameItems.add(new GameItem("Flax", "@drawable/flax", "flowers"));
			gameItems.add(new GameItem("Gerbera", "@drawable/gerbera",
					"flowers"));
			gameItems.add(new GameItem("Hibiscus", "@drawable/hibiscus",
					"flowers"));
			gameItems.add(new GameItem("Ixia", "@drawable/ixia", "flowers"));
			gameItems.add(new GameItem("Jasmine", "@drawable/jasmine",
					"flowers"));
			gameItems
					.add(new GameItem("Kerria", "@drawable/kerria", "flowers"));
			gameItems.add(new GameItem("Lotus", "@drawable/lotus", "flowers"));
			gameItems.add(new GameItem("Magnolia", "@drawable/magnolia",
					"flowers"));
			gameItems.add(new GameItem("Narcissus", "@drawable/narcissus",
					"flowers"));
			gameItems
					.add(new GameItem("Orchid", "@drawable/orchid", "flowers"));
			gameItems.add(new GameItem("Pansy", "@drawable/pansy", "flowers"));
			gameItems.add(new GameItem("Quisqualis", "@drawable/quisqualis",
					"flowers"));
			gameItems.add(new GameItem("Rose", "@drawable/rose", "flowers"));
			gameItems.add(new GameItem("Snowdrop", "@drawable/snowdrop",
					"flowers"));
			gameItems.add(new GameItem("Tulip", "@drawable/tulip", "flowers"));
			gameItems.add(new GameItem("Ursinia", "@drawable/ursinia",
					"flowers"));
			gameItems.add(new GameItem("Vellozia", "@drawable/vellozia",
					"flowers"));
			gameItems.add(new GameItem("Watsonia", "@drawable/watsonia",
					"flowers"));
			gameItems.add(new GameItem("Xeranthemum", "@drawable/xeranthemum",
					"flowers"));
			gameItems
					.add(new GameItem("Yarrow", "@drawable/yarrow", "flowers"));
			gameItems
					.add(new GameItem("Zinnia", "@drawable/zinnia", "flowers"));

		}

		public String name;
		public String drawable;
		public String type;
		public int id;

		static private int idX = 0;

		public GameItem(String name, String drawable, String type) {

			this.id = idX++;
			this.name = name;
			this.drawable = drawable;
			this.type = type;

		}
	}

}
